

clear all;

tGPS = 946339215;	% January 1, 2010

% Find the Earth's GMSTrad at this time
gmst = 23017.062492823;
gmstRad = gmst*pi/43200;

%--LHO detector
H1.long		= -2.08405676917;
H1.lat		= 0.81079526383;
H1.elevation	= 142.554;
H1.Ax		= -6.195e-4;
H1.PsiX		= 324.0006*pi/180.0;
H1.Ay		= 1.25e-5;
H1.PsiY		= 234.0006*pi/180.0;
H1.lmst 	= mod((gmstRad + H1.long), (2*pi));
H1.xArm		= getArm(H1.PsiX, H1.Ax, H1.long, H1.lat);
H1.yArm		= getArm(H1.PsiY, H1.Ay, H1.long, H1.lat);
H1.detTensor	= 0.5*(H1.xArm'*H1.xArm - H1.yArm'*H1.yArm);
[H1.ah, H1.bh] = CalculateDetPosDepCoeffs(H1.PsiX, H1.PsiY, H1.lat);

%-- LLO Detector
H2.long		= -1.58430937078;
H2.lat		= 0.53342313506;
H2.elevation	= -6.574;
H2.Ax		= -3.121e-4;
H2.PsiX		= 252.2835*pi/180.0;
H2.Ay		= -6.107e-4;
H2.PsiY		= 162.2835*pi/180.0;
H2.lmst 	= mod((gmstRad + H2.long), (2*pi));
H2.xArm		= getArm(H2.PsiX, H2.Ax, H2.long, H2.lat);
H2.yArm		= getArm(H2.PsiY, H2.Ay, H2.long, H2.lat);
H2.detTensor	= 0.5*(H2.xArm'*H2.xArm - H2.yArm'*H2.yArm);
[H2.ah, H2.bh] = CalculateDetPosDepCoeffs(H2.PsiX, H2.PsiY, H2.lat);

% Virgo Detector
V1.long		= 0.18333805213;
V1.lat		= 0.76151183984;
V1.elevation	= 51.884;
V1.Ax		= 0;
V1.PsiX		= 19.4326*pi/180.0;
V1.Ay		= 0;
V1.PsiY		= 289.4326*pi/180.0;
V1.lmst 	= mod((gmstRad + V1.long), (2*pi));
V1.xArm		= getArm(V1.PsiX, V1.Ax, V1.long, V1.lat);
V1.yArm		= getArm(V1.PsiY, V1.Ay, V1.long, V1.lat);
V1.detTensor	= 0.5*(V1.xArm'*V1.xArm - V1.yArm'*V1.yArm);
[V1.ah, V1.bh] = CalculateDetPosDepCoeffs(V1.PsiX, V1.PsiY, V1.lat);

% Draw up a list of n sky positions
nSky = 10;
delta = -pi/2 + pi.*rand(nSky,1);
alpha = 2*pi*rand(nSky,1);

[at, bt] = CalculateAtBt(H2, alpha, delta);











